package asia.kalin.config;

import asia.kalin.interceptors.LoginInterceptors;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @Author: Kalin
 * @Name：WebConfig
 * @Date: 2025/3/10
 * @description
 */

@Configuration
@RequiredArgsConstructor
public class WebConfig implements WebMvcConfigurer {

    private final LoginInterceptors loginInterceptors;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        // 登录不拦截和测试接口不拦截
        registry.addInterceptor(loginInterceptors).excludePathPatterns("/user/login","/user/register","/detectionResult/queryByType","/detectionResult/queryById","/camera/queryCameraList","/camera/getCameraById","/camera/getResultByCId");
    }
}
